<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Topsis extends Controller {

    public function __construct() {
        parent::__construct();
//        echo 'we in about';
        Session::init();

        $loggeg = Session::get('loggedIn');
        if ($loggeg == false) {
            Session::Destroy();
            header('location: ' . URL . 'error');
            exit;
        }
    }

    public function index() {
        $this->view->list_profile_topsis = $this->model->list_profile_topsis();
        $this->view->render('topsis/index');
    }

    public function create_profile() {
        $this->view->render('topsis/create_profile');
    }

    public function add_profile_topsis() {

        $this->view->render('topsis/add_profile_topsis');
    }

    public function save_profile_topsis() {

        $data['profile_id'] = $_POST['profile_id'];
        $data['nama_profile'] = $_POST['nama_profile'];

        $this->model->add_profile_topsis($data);
        header('location:' . URL . 'topsis/index');
    }

    public function do_topsis($profile_id) {

        $this->view->do_topsis = $this->model->do_topsis($profile_id);

        $this->view->render('topsis/topsis_result');
    }

}

?>
